package com.mybatis.config;

import com.mybatis.Filter.LoginFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liuxiaoding
 * @Date 2019/11/14
 **/
@Configuration
public class FilterConfig {

//    @Bean
//    public FilterRegistrationBean myFilterRegistration(){
//        FilterRegistrationBean regist = new FilterRegistrationBean(new LoginFilter());
//        // 过滤全部请求
//        regist.addUrlPatterns("/user/*");
//        regist.setName("loginFilter");
//        //过滤器优先级，值越小优先级越高，用来控制过滤器执行顺序
//        regist.setOrder(0);
//        return regist;
//    }
}
